package com.myshiro.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/user")
public class SysUserController {

    @RequestMapping({"/list"})
    public String list(){
        return "list";
    }

    @RequestMapping({"/add"})
    public String add(){
        return "add";
    }

    @RequestMapping({"/update"})
    //使用注解 完成授权
    @RequiresPermissions(value ={"user:update"} )
    public String update(){
        return "update";
    }

    @RequestMapping({"/view/{id}"})
    public String view(@PathVariable String id){
        System.out.println("--------id: "+ id);
        return "view";
    }

}
